﻿using System;
using System.Collections.Generic;

namespace nRoute.Mapping
{
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = true, Inherited = false)]
    public abstract class ResourceMetaAttributeBase
        : Attribute
    {

#region Overridable

        /// <summary>Returns the resource type, the meta is applicable to</summary>
        /// <param name="targetType">The type onto which the attribute was applied</param>
        /// <returns>The resource type to which the attribute is applicable, can be null if unknown</returns>
        protected internal abstract Type GetResourceType(Type targetType);

        protected internal virtual void AppendMeta(Type resourceType, string key, IDictionary<string, Object> metadata)
        {
        }

#endregion

    }
}
